<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>修改商品页</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

    <script type="text/javascript" src="http://localhost:8080/SST//util/jquery.min.js"></script>

	<style type="text/css">
	        input{
	        	height: 40px;
	        	width: 200px;
	        }
         	select{
        		width: 200px;
        	}
        	img{
	        	width: 200px;
        	}
        </style>
          
      <script type="text/javascript">
        	$(function(){
        //获取大分类
          $(".bigClass").append("<option value="+0+">请选择</option>"); 
              $.ajax({ 
			     type: "post",
			     //大分类查询地址
			     url: "http://localhost:8080/SST/view/getBigClass.do", 
			     success: function(msg){ 
			    	 //成功 执行回调函数
			    	 var list = eval(msg);// msg是返回数据
			    	 $.each(list,function(index,c){
			    		$(".bigClass").append("<option value="+c.bigclass_id+">"+c.bigtitle+"</option>"); 
			    	 });
			    	 } 	
                   
                   });
            
         
            
        //获取小分类
            $(".bigClass").change(function(){
    			var caseID = $(".bigClass").val();
    			 $(".smallClass").empty();
    			$(".smallClass").append("<option value="+0+">请选择</option>");
    			$.ajax({ 
    			     type: "post",
    			     //小分类查询地址
    			     url: "http://localhost:8080/SST/view/getSmallClass.do", 
    			     data: "bigclassId="+caseID, 
    			     success: function(msg){ 
    			    	 //成功 执行回调函数
   
    			    	 var list = eval(msg);// msg是返回数据
    			    	 $.each(list,function(index,c){
    			    		$(".smallClass").append("<option value="+c.id+">"+c.case1+"</option>"); 
    			    	 });
    			    	 } 	
    			});
    		

        	});        
        	});
        	
        
        </script>
  </head>
  
  <body>
            修改商品:
       <form action="view/goodsupdate.do" method="post" enctype="multipart/form-data">
    		
    		 商品名：<input type="text" name="goods_name" value="${goodsupdateone.goods_name }"/><br/>
    		商品描述：<input type="text" name="goods_detail" value="${goodsupdateone.goods_detail }"/><br/>
    		商品原图：<span><img alt="" src="/goods/images/${goodsupdateone.goods_dimage }"></span>
    		商品图片：<input type="file" name="loadfile"/><br/>
    		
    	 	商品分类：<select class="bigClass">
    	 		
    	 	</select>
    	 	<select class="smallClass" name="is_good">
    	 		
    	 	</select><br/>
    		商品价格：<input type="text" name="goods_price" value="${goodsupdateone.goods_price }"/><br/>
    		商品链接：<input type="text" name="goods_src" value="${goodsupdateone.goods_src }"/><br/> 
    			<input type="hidden" name="goods_id" value="${goodsupdateone.goods_id }"/>
    		<input type="submit" value="提交" >
    	</form>
  </body>
</html>
